[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+-------+##################################################################
#+-| DOW() |-----------------------------------+##############################
#| +-------+ Converts date_value into a number |##############################
#+---------------------------------------------+##############################
##############################################################################
##############################################################################
#+--| Summary |--------------+################################################
#| #INCLUDE date.hdr |################################################
#+---------------------------+################################################
##############################################################################
##############################################################################
#+--| Syntax |-------------------------------+################################
#| FUNCTION INT dow PROTOTYPE |################################
#| PARAMETERS VALUE DATE date_value |################################
#+-------------------------------------------+################################
##############################################################################
##############################################################################
###########+---| Description |------------------------------------+###########
###########| The dow() function converts date_value into a number |###########
###########| representing the day of the week. Sunday is |###########
###########| considered day 1 and Saturday is day 7. |###########
###########+------------------------------------------------------+###########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Send a note to all workers about FAC. |#########
#########| |#########
#########| IF dow( today() ) = 6 |#########
#########| ? "Friday Afternoon Club!!!" |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Index sales by dow() to see when the demand |#########
#########| * is greatest. |#########
#########| |#########
#########| #include date.hdr |#########
#########| |#########
#########| DBFDEF sales |#########
#########| CHAR(20) item |#########
#########| DATE date |#########
#########| DBL(10:2) price |#########
#########| ENDDEF |#########
#########| VARDEF |#########
#########| INT i |#########
#########| DBL daily[7] |#########
#########| ENDDEF |#########
#########| |#########
#########| PROCEDURE force_main |#########
#########| USE sales |#########
#########| FOR i = 1 TO 7 |#########
#########| SUM FOR i = dow( sales->date ) TO daily[i-1] |#########
#########| NEXT |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
cdow()
cmonth()
ctod()
day()
days_btw_dates()
days_from()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson